import {post, get, DCAPI} from "libs/api"

const EXCHANGE = `${DCAPI}exchange/`

export function getById (id) {
  return get(`${EXCHANGE}getExchangeProjectByProjectId/${id}`)
}
// 数据交换列表
export function dataExchangeList (data) {
  return post(`${EXCHANGE}exchangeTaskQuery`, JSON.stringify(data))
}
// 数据交换详情
export function dataExchangeDetail (query) {
  return post(`${EXCHANGE}getExchangeById/${query.id}`, JSON.stringify(query))
}
// 根据项目id查询数据交换信息
export function getExchangeInfoFormProjectId (id) {
  return get(`${EXCHANGE}getExchangeProjectByProjectId/${id}`)
}
// 新增数据交换
export function addExchange (type, params) {
  return post(`${EXCHANGE}/type${type}`, JSON.stringify(params))
}
// 重命名数据交换
export function renameExchange (params) {
  return post(`${EXCHANGE}resetTaskName`, JSON.stringify(params))
}
// 删除
export function delExchange (params) {
  return get(`${EXCHANGE}deletedExchange/${params.id}`)
}
